﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class navigation : System.Web.UI.UserControl
{

    private List<string> _urls;
    List<string> _names;

    public List<string> urls
    {
        set
        {
            _urls = value;
        }
        get{
            return _urls;
        }
    }
    public List<string> names
    {
        set
        {
            _names = value;
            int i;
            for (i = 0; i < _names.Count; ++i)
            {
                if (_names[i].Length > 20)
                {
                    _names[i] = _names[i].Substring(0, 17) + "...";
                }
            }
        }
        get
        {
            return _names;
        }
    }


    protected void Page_Load(object sender, EventArgs e)
    {
        int i;

        for (i=0;i<names.Count-1;++i)
        {
            Literal1.Text += "<li><a href=\""+urls[i]+"\">"+names[i]+"</a></li>";
            Literal1.Text += "<li> >> </li> ";
        }
        if (i < names.Count)
        {
            Literal1.Text += "<li><a href=\"" + urls[i] + "\">" + names[i] +"</a></li>";
        }
        //Response.Write(Literal1.Text);
    }
}